/////////////////////////////////////////////////////////////////////////////////////
// Include Files
#include "Objects\Sphere.h"

#include <gl\GL.h>

/////////////////////////////////////////////////////////////////////////////////////
// CSphere Implementation

CSphere::CSphere() : ABCObject()
{
	//// get the shader manager
	//m_pShaderManager = CShaderManager::GetInstance();

	//// load the vertex program
	//m_iVertexProgram = m_pShaderManager->LoadVertexProgram( 
	//	"..\\Galleons\\Shaders\\Sphere.shader", "main" );

	//modelViewMatrix = m_pShaderManager->GetParameter( 
	//	m_iVertexProgram, "ModelViewProj" );

	//// HACK: pyramid

	//obj_vector pos;
	//obj_color  col;

	//SetVertexCount(18);

	//// front

	//col.r = 1.0f; col.g = 0.0f; col.b = 0.0f;
	//pos.x = 0.0f; pos.y = 1.0f; pos.z = 0.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 1.0f; col.b = 0.0f;
	//pos.x = -1.0f; pos.y = -1.0f; pos.z = 1.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 0.0f; col.b = 1.0f;
	//pos.x = 1.0f; pos.y = -1.0f; pos.z = 1.0f;
	//AddVertex( pos, col );

	//// right

	//col.r = 1.0f; col.g = 0.0f; col.b = 0.0f;
	//pos.x = 0.0f; pos.y = 1.0f; pos.z = 0.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 0.0f; col.b = 1.0f;
	//pos.x = 1.0f; pos.y = -1.0f; pos.z = 1.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 1.0f; col.b = 0.0f;
	//pos.x = 1.0f; pos.y = -1.0f; pos.z = -1.0f;
	//AddVertex( pos, col );

	//// back

	//col.r = 1.0f; col.g = 0.0f; col.b = 0.0f;
	//pos.x = 0.0f; pos.y = 1.0f; pos.z = 0.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 1.0f; col.b = 0.0f;
	//pos.x = 1.0f; pos.y = -1.0f; pos.z = -1.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 0.0f; col.b = 1.0f;
	//pos.x = -1.0f; pos.y = -1.0f; pos.z = -1.0f;
	//AddVertex( pos, col );

	//// left

	//col.r = 1.0f; col.g = 0.0f; col.b = 0.0f;
	//pos.x = 0.0f; pos.y = 1.0f; pos.z = 0.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 0.0f; col.b = 1.0f;
	//pos.x = -1.0f; pos.y = -1.0f; pos.z = -1.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 1.0f; col.b = 0.0f;
	//pos.x = -1.0f; pos.y = -1.0f; pos.z = 1.0f;
	//AddVertex( pos, col );

	//// bottom

	//col.r = 0.0f; col.g = 1.0f; col.b = 0.0f;
	//pos.x = -1.0f; pos.y = -1.0f; pos.z = 1.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 1.0f; col.b = 0.0f;
	//pos.x = 1.0f; pos.y = -1.0f; pos.z = -1.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 0.0f; col.b = 1.0f;
	//pos.x = 1.0f; pos.y = -1.0f; pos.z = 1.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 0.0f; col.b = 1.0f;
	//pos.x = -1.0f; pos.y = -1.0f; pos.z = -1.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 1.0f; col.b = 0.0f;
	//pos.x = 1.0f; pos.y = -1.0f; pos.z = -1.0f;
	//AddVertex( pos, col );

	//col.r = 0.0f; col.g = 1.0f; col.b = 0.0f;
	//pos.x = -1.0f; pos.y = -1.0f; pos.z = 1.0f;
	//AddVertex( pos, col );
}

CSphere::~CSphere()
{
	//// TODO: I have to clear my lists to prevent leaking memory, this should not be necessary
	//m_lstPositions.Clear();
	//m_lstColors.Clear();

	//// release the shader manager
	//m_pShaderManager->UnloadProgram(m_iVertexProgram);
	//// TODO: shader manager needs program ref count
	//m_pShaderManager->Release();
}

void CSphere::Update( float_t _fTime )
{
	(void)_fTime;
}
